<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>小米商城</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1,user-scalable=0">
		<link rel="stylesheet" type="text/css" href="dist/css/swiper.min.css"/>
		<link rel="stylesheet" type="text/css" href="css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="css/mi.css"/>
	</head>
	<body>
		<div id="wrap">
			<!--input-->
			<div id="index-header">
				<img src="img/logo_e6453b2.png"/>
				<a href="#">搜索商品名称</a>
				<div>登录</div>
			</div>
			<!--轮播图-->
			<div id="slider" class="swiper-container">
				<div class="swiper-wrapper">
				<script type="text/template" id="tem">
					<%for(i=0;i<4;i++){%>
						<div class="swiper-slide">
						<img src="<%=items[i].img_url%>"/>
						</div>
					<%}%>
				</script>
				</div>
				<!--<div class="swiper-wrapper">
		            <div class="swiper-slide"><img src="img/banner1.jpg"/></div>
		            <div class="swiper-slide"><img src="img/banner2.jpg"/></div>
		            <div class="swiper-slide"><img src="img/banner3.jpg"/></div>
		            <div class="swiper-slide"><img src="img/banner4.jpg"/></div>
		       </div>-->
		        <div class="swiper-pagination"></div>
			</div>
			<!--快报-->
			<div id="quickNews">
				<img src="img/sczb_ed0a4af.png"/><span style="color: darkgray;">|</span>
				<!--快报百度模板-->
				<script type="text/template" id="quickNews_list">
					<div>
					</div>
				</script>
			</div>
			<!--小米商品-->
			<div id="miProduct">
				<div class="item"></div>
				<div class="item"</div>
				<div class="item1"></div>
			</div>
			<!--小米笔记本-->
			<div id="miAir">
				
			</div>
			<!--小米明星产品-->
			<div id="miStar">
				
			</div>
			<!--小米5c-->
			<div id="mi5C">
				
			</div>
			<!--小米车载-->
			<div id="miCar">
				
			</div>
			<!--小米耳机-->
			<div id="miEar">
				
			</div>
			
		</div>	
	</body>
	<script src="dist/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/jquery-2.2.3.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="baiduTemplate.js">
		
	</script>
	<script type="text/javascript">
    var arr=["《米粉有趣评之六一特别篇》","红米Note4X为什么更值得购买","1秒让空调变智能!空调伴侣169元首发"]
    var index = 0
    setInterval(function(){
    	if(index>2){
    		index=0
    	}
    	$('#newsWord').fadeIn(200).delay(1000).fadeOut(200).html(arr[index]);
    	index++
    },1400)
    
				//  ajax请求数据
	$.get('index.json',function(data){
//		console.log(data.data.header.body.items);
		dealDate(data);
//		console.log(data);
		var swiper = new Swiper('.swiper-container', {
			        	pagination: '.swiper-pagination',
			        	paginationClickable: true,
			       		autoplay:1000,
			        	// Enable debugger
			        	debugger: true
		    		});
	});
	function dealDate(data){
		var html0 = baidu.template("tem",data.data.header.body)
		$(".swiper-wrapper").html(html0);
	}
	
	
	</script>
</html>
